package com.dalin.platform.glb.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

import com.dalin.common.base.BaseObject;
/*****************************************************************************
 * @content: 字典表细目类信息                                                                                                                 *
 * @author : 那建林                                                                                                                                 *
 * @crtDate: 2010-05-11                                                     *
 * @modDate: 2010-05-11                                                     *
 * @version: 1.00                                                           *
 ****************************************************************************/
@Entity
@Table(name="GLB_DIC_ITEM_REPOSITORY")
public class GlbDicItemRepositoryEntity extends BaseObject {
    private Long itemId; // ITEM_ID,16,0
    private Long typeId; // TYPE_ID,16,0
	private Integer itemCode; // ITEM_CODE,8,0
    private String itemName; // ITEM_NAME,256,0
    private Integer parentItemCode; // PARENT_ITEM_CODE,8,0
    private Integer orderNumber; // ORDER_NUMBER,8,0
    private String remark; // REMARK,512,0



	@Id
    @Column(name="ITEM_ID")
    @GeneratedValue(strategy = GenerationType.TABLE,generator="generator_normal")
    @TableGenerator(
        name = "generator_normal",
        table = "GLB_GENERATOR_KEY",
        pkColumnName = "GEN_KEY",
        valueColumnName = "GEN_VALUE",
        pkColumnValue = "GLB_DIC_ITEM_REPOSITORY",
        allocationSize=1
    )
    public Long getItemId() {
        return itemId;
    }

    public void setItemId(Long itemId) {
        this.itemId = itemId;
    }

    @Column(name = "TYPE_ID")
    public Long getTypeId() {
		return typeId;
	}

	public void setTypeId(Long typeId) {
		this.typeId = typeId;
	}
	
    @Column(name="ITEM_CODE")
    public Integer getItemCode() {
        return itemCode;
    }

	public void setItemCode(Integer itemCode) {
        this.itemCode = itemCode;
    }

    @Column(name="ITEM_NAME")
    public String getItemName() {
        return itemName;
    }

    public void setItemName(String itemName) {
        this.itemName = itemName;
    }

    @Column(name="PARENT_ITEM_CODE")
	public Integer getParentItemCode() {
		return parentItemCode;
	}
    public void setParentItemCode(Integer parentItemCode) {
		this.parentItemCode = parentItemCode;
	}

	
    @Column(name="ORDER_NUMBER")
    public Integer getOrderNumber() {
        return orderNumber;
    }
    public void setOrderNumber(Integer orderNumber) {
        this.orderNumber = orderNumber;
    }
	
    @Column(name="REMARK")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}
	

    @Override
    public int hashCode() {
        int njlrst = 17;
        njlrst = 31 * njlrst + (itemId == null ? 0 : itemId.hashCode());
        njlrst = 31 * njlrst + (typeId == null ? 0 : typeId.hashCode());
        njlrst = 31 * njlrst + (itemCode == null ? 0 : itemCode.hashCode());
        njlrst = 31 * njlrst + (itemName == null ? 0 : itemName.hashCode());
        njlrst = 31 * njlrst + (parentItemCode == null ? 0 : parentItemCode.hashCode());
        njlrst = 31 * njlrst + (orderNumber == null ? 0 : orderNumber.hashCode());
        njlrst = 31 * njlrst + (remark == null ? 0 : remark.hashCode());
        return njlrst;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof GlbDicItemRepositoryEntity)) return false;
        final GlbDicItemRepositoryEntity other = (GlbDicItemRepositoryEntity) o;
        if (itemId == null) {
            if (other.itemId != null) return false;
        } else if (!itemId.equals(other.itemId)) {
            return false;
        }
        if (typeId == null) {
            if (other.typeId != null) return false;
        } else if (!typeId.equals(other.typeId)) {
            return false;
        }
        if (itemCode == null) {
            if (other.itemCode != null) return false;
        } else if (!itemCode.equals(other.itemCode)) {
            return false;
        }
        if (itemName == null) {
            if (other.itemName != null) return false;
        } else if (!itemName.equals(other.itemName)) {
            return false;
        }
        if (parentItemCode == null) {
            if (other.parentItemCode != null) return false;
        } else if (!parentItemCode.equals(other.parentItemCode)) {
            return false;
        }
        if (orderNumber == null) {
            if (other.orderNumber != null) return false;
        } else if (!orderNumber.equals(other.orderNumber)) {
            return false;
        }
        if (remark == null) {
            if (other.remark != null) return false;
        } else if (!remark.equals(other.remark)) {
            return false;
        }
        return true;
    }
}
